remove unused functions from Utility.RawFilePath
authorJoey Hess <joeyh@joeyh.name>
Tue, 11 Feb 2025 17:49:17 +0000 (13:49 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 11 Feb 2025 17:49:17 +0000 (13:49 -0400)
Annex/Ssh.hs
Git/Construct.hs
Utility/RawFilePath.hs

index b1184ccc142c97789d447374e97c120db2f4d511..07519d03904bb702e51215de4c612db39dc00660 100644 (file)
@@ -39,7 +39,6 @@ import Annex.Concurrent.Utility
 import Types.Concurrency
 import Git.Env
 import Git.Ssh
-import qualified Utility.RawFilePath as R
 import qualified Utility.OsString as OS
 import Annex.Perms
 #ifndef mingw32_HOST_OS
index 229af82affaa9bb181da93bec68dd78ac10a9058..3d503a5ebce55cf72ba4acfef76fbaf71e8ea845 100644 (file)
@@ -40,13 +40,12 @@ import Git.FilePath
 import qualified Git.Url as Url
 import Utility.UserInfo
 import Utility.Url.Parse
-import qualified Utility.RawFilePath as R
 import qualified Utility.OsString as OS
 
 {- Finds the git repository used for the cwd, which may be in a parent
  - directory. -}
 fromCwd :: IO (Maybe Repo)
-fromCwd = R.getCurrentDirectory >>= seekUp . toOsPath
+fromCwd = getCurrentDirectory >>= seekUp
   where
        seekUp dir = do
                r <- checkForRepo dir
index f07a39f6c4ed436b5446fe5f750f4506f1ee286d..e10f05d703b6bb304435c98b645fdcb5b20f4f37 100644 (file)
@@ -22,12 +22,8 @@ module Utility.RawFilePath (
        readSymbolicLink,
        createSymbolicLink,
        createLink,
-       removeLink,
        getFileStatus,
        getSymbolicLinkStatus,
-       doesPathExist,
-       getCurrentDirectory,
-       createDirectory,
        setFileMode,
        setOwnerAndGroup,
        rename,
@@ -38,18 +34,6 @@ module Utility.RawFilePath (
 #ifndef mingw32_HOST_OS
 import Utility.FileSystemEncoding (RawFilePath)
 import System.Posix.Files.ByteString
-import qualified System.Posix.Directory.ByteString as D
-
--- | Checks if a file or directory exists. Note that a dangling symlink
--- will be false.
-doesPathExist :: RawFilePath -> IO Bool
-doesPathExist = fileExist
-
-getCurrentDirectory :: IO RawFilePath
-getCurrentDirectory = D.getWorkingDirectory
-
-createDirectory :: RawFilePath -> IO ()
-createDirectory p = D.createDirectory p 0o777
 
 #else
 import System.PosixCompat (FileStatus, FileMode)
@@ -89,15 +73,6 @@ getSymbolicLinkStatus :: RawFilePath -> IO FileStatus
 getSymbolicLinkStatus p = P.getSymbolicLinkStatus . fromRawFilePath
        =<< convertToWindowsNativeNamespace p
 
-doesPathExist :: RawFilePath -> IO Bool
-doesPathExist = D.doesPathExist . fromRawFilePath
-
-getCurrentDirectory :: IO RawFilePath
-getCurrentDirectory = toRawFilePath <$> D.getCurrentDirectory
-
-createDirectory :: RawFilePath -> IO ()
-createDirectory = D.createDirectory . fromRawFilePath
-
 setFileMode :: RawFilePath -> FileMode -> IO () 
 setFileMode p m = do
        p' <- fromRawFilePath <$> convertToWindowsNativeNamespace p